package com.ghsc.ghxc.jsb.ui.bean

import com.ghsc.ghxc.jsb.config.CustKey

/**
 * 项目：GuoHuaJsb
 * 包名：com.ghsc.ghxc.jsb.ui.bean
 * 类名：MyBeanData
 * 创建时间：2024/4/23 10:33
 * 创建人 @author： xiaolin
 * 描述 ：Todo...
 */

data class SysConfigResult(
    val `data`: SysConfigResultData,
    val list: List<SysConfigBean>
){
    fun getAgreementUrl(): String {
        var url :String=""
        for(i in list.indices)
            if (list[i].cfg_key== CustKey.configK8){
                url=list[i].cfg_value
                break
            }
        return url
    }
    /**
     * 启动页
     */
    fun getStrImg(): String {
        var str :String?=null
        for(i in list.indices)
            if (list[i].cfg_key==CustKey.configK13){
                str=list[i].cfg_value
                break
            }

        return str!!
    }
    /**
     * 积分超市
     */
    fun getWebView(): SysConfigBean {
        var str :SysConfigBean?=null
        for(i in list.indices)
            if (list[i].cfg_key==CustKey.configK7){
                str=list[i]
                break
            }

        return str!!
    }


    fun getSysConfigBean(key:String): SysConfigBean? {
        var str :SysConfigBean?=null
        for(i in list.indices)
            if (list[i].cfg_key==key){
                str=list[i]
                break
            }
        return str!!
    }

}

class SysConfigResultData
data class SysConfigBean(
    val cfg_key: String,
    val cfg_memo: String,
    val cfg_value: String
)

data class VersionDataBean(
    var url :String,
    val version:String,
    val ifmust:Int,
    val memo :String
){
    override fun toString(): String {
        return "VersionDataBean(url='$url', version='$version', ifmust=$ifmust, memo='$memo')"
    }
}